package com.qf.service.impl;

import com.qf.mapper.CityMapper;
import com.qf.pojo.City;
import com.qf.service.CityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Mr.Liu
 * @date 2021/12/15 11:54
 */

@Service
public class CityServiceImpl implements CityService {
    @Autowired
    private CityMapper cityMapper;
    @Override
    public List<City> findAllCity(Integer pid) {
        List<City> citys = cityMapper.findAllCity(pid);
        if(citys!=null){
            return citys;
        }
        return null;
    }

    @Override
    public City findCityByGetid(Integer getid) {
        City city = cityMapper.findCityByGetid(getid);
        if(city!=null){
            return city;
        }
        return null;
    }

    /**
     * 查找还车地点
     * @param backid
     * @return
     */
    @Override
    public City findCityByBackid(Integer backid) {
        City city = cityMapper.findCityByBackid(backid);
        if(city!=null){
            return city;
        }
        return null;
    }
}
